#include <iostream> 
#include <cstdio> 

using namespace std; 

int main()
{
    char foo[6];
    int bar;

    cout << "Please enter a 5-digit integer: ";

    cin >> bar;
    foo[5] = '\0';
    snprintf(foo, 6,  "%i", bar);

    if (foo[0] == foo[4] && foo[1] == foo[3])
        printf( "%s is a palindrome ! ", foo);
    else
        printf( "%s is not a palindrome", foo );

    return 0;
}

